<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	View recipient
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<div class="pagetitle">
		<h1>
			Recipient:
			<%= ViewData[ "Email" ] %></h1>
	</div>
	<div class="pagecontent">
		<p class="actions">
			<%= Html.ActionLink( "Back to application", "View", "Application", new { id = ViewData["ApplicationID"] }, null ) %>
		</p>
		<p>
			Recipient info and statistics:
		</p>
		<p>
			Display name: <b>
				<%= ViewData["DisplayName"] %></b>
		</p>
		<p>
			Lists:<br />
			<ul>
				<% foreach (var l in (ViewData["AllLists"] as IList<Mailer.Model.Types.List>)
	   )
	   { %>
				<li>
					<%= Html.Encode(l.Name ) %>
					<% if ((ViewData["Lists"] as IList<Mailer.Model.Types.List>).Contains(l))
		{ %>
					XX
					<% } %>
					<%= Html.ActionLink("Join", "Join", "Recipient", new { recipient = ViewData[ "ID" ], list = l.ID }, null)%>
					<%= Html.ActionLink("Leave", "Leave", "Recipient", new { recipient = ViewData["ID"], list = l.ID }, null)%>
				</li>
				<% } %>
			</ul>
		</p>
	</div>
</asp:Content>
